3.7.95 \(\int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x)) \, dx\) [695]

Optimal. Leaf size=61 \[ -\frac {a^3 (i A-B) c (1+i \tan (e+f x))^3}{3 f}-\frac {a^3 B c (1+i \tan (e+f x))^4}{4 f} \]

[Out]

-1/3*a^3*(I*A-B)*c*(1+I*tan(f*x+e))^3/f-1/4*a^3*B*c*(1+I*tan(f*x+e))^4/f

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.051, Rules used = {3669, 45} \begin {gather*} -\frac {a^3 c (-B+i A) (1+i \tan (e+f x))^3}{3 f}-\frac {a^3 B c (1+i \tan (e+f x))^4}{4 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x]),x]

[Out]

-1/3*(a^3*(I*A - B)*c*(1 + I*Tan[e + f*x])^3)/f - (a^3*B*c*(1 + I*Tan[e + f*x])^4)/(4*f)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3669

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a*(c/f), Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x)) \, dx &=\frac {(a c) \text {Subst}\left (\int (a+i a x)^2 (A+B x) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left ((A+i B) (a+i a x)^2-\frac {i B (a+i a x)^3}{a}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {a^3 (i A-B) c (1+i \tan (e+f x))^3}{3 f}-\frac {a^3 B c (1+i \tan (e+f x))^4}{4 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(161\) vs. \(2(61)=122\).
time = 1.37, size = 161, normalized size = 2.64 \begin {gather*} \frac {a^3 c \sec (e) \sec ^4(e+f x) (3 (2 i A+B) \cos (e)+3 (i A+B) \cos (e+2 f x)+3 i A \cos (3 e+2 f x)+3 B \cos (3 e+2 f x)-6 A \sin (e)+3 i B \sin (e)+5 A \sin (e+2 f x)-i B \sin (e+2 f x)-3 A \sin (3 e+2 f x)+3 i B \sin (3 e+2 f x)+2 A \sin (3 e+4 f x)-i B \sin (3 e+4 f x))}{12 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x]),x]

[Out]

(a^3*c*Sec[e]*Sec[e + f*x]^4*(3*((2*I)*A + B)*Cos[e] + 3*(I*A + B)*Cos[e + 2*f*x] + (3*I)*A*Cos[3*e + 2*f*x] +
 3*B*Cos[3*e + 2*f*x] - 6*A*Sin[e] + (3*I)*B*Sin[e] + 5*A*Sin[e + 2*f*x] - I*B*Sin[e + 2*f*x] - 3*A*Sin[3*e +
2*f*x] + (3*I)*B*Sin[3*e + 2*f*x] + 2*A*Sin[3*e + 4*f*x] - I*B*Sin[3*e + 4*f*x]))/(12*f)

________________________________________________________________________________________

Maple [A]
time = 0.10, size = 63, normalized size = 1.03

method result size
derivativedivides \(\frac {a^{3} c \left (-\frac {B \left (\tan ^{4}\left (f x +e \right )\right )}{4}-\frac {\left (-2 i B +A \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3}-\frac {\left (-2 i A -B \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2}+A \tan \left (f x +e \right )\right )}{f}\) \(63\)
default \(\frac {a^{3} c \left (-\frac {B \left (\tan ^{4}\left (f x +e \right )\right )}{4}-\frac {\left (-2 i B +A \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3}-\frac {\left (-2 i A -B \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2}+A \tan \left (f x +e \right )\right )}{f}\) \(63\)
norman \(\frac {A \,a^{3} c \tan \left (f x +e \right )}{f}-\frac {\left (-2 i B \,a^{3} c +A \,a^{3} c \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}+\frac {\left (2 i A \,a^{3} c +B \,a^{3} c \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}-\frac {B \,a^{3} c \left (\tan ^{4}\left (f x +e \right )\right )}{4 f}\) \(91\)
risch \(\frac {4 a^{3} c \left (6 i A \,{\mathrm e}^{6 i \left (f x +e \right )}+6 B \,{\mathrm e}^{6 i \left (f x +e \right )}+12 i A \,{\mathrm e}^{4 i \left (f x +e \right )}+6 B \,{\mathrm e}^{4 i \left (f x +e \right )}+8 i A \,{\mathrm e}^{2 i \left (f x +e \right )}+4 B \,{\mathrm e}^{2 i \left (f x +e \right )}+2 i A +B \right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{4}}\) \(104\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

1/f*a^3*c*(-1/4*B*tan(f*x+e)^4-1/3*(A-2*I*B)*tan(f*x+e)^3-1/2*(-2*I*A-B)*tan(f*x+e)^2+A*tan(f*x+e))

________________________________________________________________________________________

Maxima [A]
time = 0.55, size = 76, normalized size = 1.25 \begin {gather*} -\frac {3 \, B a^{3} c \tan \left (f x + e\right )^{4} + 4 \, {\left (A - 2 i \, B\right )} a^{3} c \tan \left (f x + e\right )^{3} - 6 \, {\left (2 i \, A + B\right )} a^{3} c \tan \left (f x + e\right )^{2} - 12 \, A a^{3} c \tan \left (f x + e\right )}{12 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e)),x, algorithm="maxima")

[Out]

-1/12*(3*B*a^3*c*tan(f*x + e)^4 + 4*(A - 2*I*B)*a^3*c*tan(f*x + e)^3 - 6*(2*I*A + B)*a^3*c*tan(f*x + e)^2 - 12
*A*a^3*c*tan(f*x + e))/f

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 139 vs. \(2 (53) = 106\).
time = 5.61, size = 139, normalized size = 2.28 \begin {gather*} -\frac {4 \, {\left (6 \, {\left (-i \, A - B\right )} a^{3} c e^{\left (6 i \, f x + 6 i \, e\right )} + 6 \, {\left (-2 i \, A - B\right )} a^{3} c e^{\left (4 i \, f x + 4 i \, e\right )} + 4 \, {\left (-2 i \, A - B\right )} a^{3} c e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-2 i \, A - B\right )} a^{3} c\right )}}{3 \, {\left (f e^{\left (8 i \, f x + 8 i \, e\right )} + 4 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 6 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 4 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e)),x, algorithm="fricas")

[Out]

-4/3*(6*(-I*A - B)*a^3*c*e^(6*I*f*x + 6*I*e) + 6*(-2*I*A - B)*a^3*c*e^(4*I*f*x + 4*I*e) + 4*(-2*I*A - B)*a^3*c
*e^(2*I*f*x + 2*I*e) + (-2*I*A - B)*a^3*c)/(f*e^(8*I*f*x + 8*I*e) + 4*f*e^(6*I*f*x + 6*I*e) + 6*f*e^(4*I*f*x +
 4*I*e) + 4*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 218 vs. \(2 (48) = 96\).
time = 0.31, size = 218, normalized size = 3.57 \begin {gather*} \frac {8 i A a^{3} c + 4 B a^{3} c + \left (32 i A a^{3} c e^{2 i e} + 16 B a^{3} c e^{2 i e}\right ) e^{2 i f x} + \left (48 i A a^{3} c e^{4 i e} + 24 B a^{3} c e^{4 i e}\right ) e^{4 i f x} + \left (24 i A a^{3} c e^{6 i e} + 24 B a^{3} c e^{6 i e}\right ) e^{6 i f x}}{3 f e^{8 i e} e^{8 i f x} + 12 f e^{6 i e} e^{6 i f x} + 18 f e^{4 i e} e^{4 i f x} + 12 f e^{2 i e} e^{2 i f x} + 3 f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e)),x)

[Out]

(8*I*A*a**3*c + 4*B*a**3*c + (32*I*A*a**3*c*exp(2*I*e) + 16*B*a**3*c*exp(2*I*e))*exp(2*I*f*x) + (48*I*A*a**3*c
*exp(4*I*e) + 24*B*a**3*c*exp(4*I*e))*exp(4*I*f*x) + (24*I*A*a**3*c*exp(6*I*e) + 24*B*a**3*c*exp(6*I*e))*exp(6
*I*f*x))/(3*f*exp(8*I*e)*exp(8*I*f*x) + 12*f*exp(6*I*e)*exp(6*I*f*x) + 18*f*exp(4*I*e)*exp(4*I*f*x) + 12*f*exp
(2*I*e)*exp(2*I*f*x) + 3*f)

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 174 vs. \(2 (53) = 106\).
time = 0.69, size = 174, normalized size = 2.85 \begin {gather*} -\frac {4 \, {\left (-6 i \, A a^{3} c e^{\left (6 i \, f x + 6 i \, e\right )} - 6 \, B a^{3} c e^{\left (6 i \, f x + 6 i \, e\right )} - 12 i \, A a^{3} c e^{\left (4 i \, f x + 4 i \, e\right )} - 6 \, B a^{3} c e^{\left (4 i \, f x + 4 i \, e\right )} - 8 i \, A a^{3} c e^{\left (2 i \, f x + 2 i \, e\right )} - 4 \, B a^{3} c e^{\left (2 i \, f x + 2 i \, e\right )} - 2 i \, A a^{3} c - B a^{3} c\right )}}{3 \, {\left (f e^{\left (8 i \, f x + 8 i \, e\right )} + 4 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 6 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 4 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e)),x, algorithm="giac")

[Out]

-4/3*(-6*I*A*a^3*c*e^(6*I*f*x + 6*I*e) - 6*B*a^3*c*e^(6*I*f*x + 6*I*e) - 12*I*A*a^3*c*e^(4*I*f*x + 4*I*e) - 6*
B*a^3*c*e^(4*I*f*x + 4*I*e) - 8*I*A*a^3*c*e^(2*I*f*x + 2*I*e) - 4*B*a^3*c*e^(2*I*f*x + 2*I*e) - 2*I*A*a^3*c -
B*a^3*c)/(f*e^(8*I*f*x + 8*I*e) + 4*f*e^(6*I*f*x + 6*I*e) + 6*f*e^(4*I*f*x + 4*I*e) + 4*f*e^(2*I*f*x + 2*I*e)
+ f)

________________________________________________________________________________________

Mupad [B]
time = 8.48, size = 72, normalized size = 1.18 \begin {gather*} \frac {-\frac {B\,c\,a^3\,{\mathrm {tan}\left (e+f\,x\right )}^4}{4}-\frac {c\,\left (A-B\,2{}\mathrm {i}\right )\,a^3\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3}+\frac {c\,\left (B+A\,2{}\mathrm {i}\right )\,a^3\,{\mathrm {tan}\left (e+f\,x\right )}^2}{2}+A\,c\,a^3\,\mathrm {tan}\left (e+f\,x\right )}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i)^3*(c - c*tan(e + f*x)*1i),x)

[Out]

(A*a^3*c*tan(e + f*x) + (a^3*c*tan(e + f*x)^2*(A*2i + B))/2 - (a^3*c*tan(e + f*x)^3*(A - B*2i))/3 - (B*a^3*c*t
an(e + f*x)^4)/4)/f

________________________________________________________________________________________